/**
  \file dawg_unique_node_set.h
  \author Francis Girard
  \date 01 october 2013

  Dawg generator graph node.
*/


/*
 *  Copyright (C) 2013, Francis Girard
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __dawg_unique_node_set_h__
#define __dawg_unique_node_set_h__

#include "dawg_arr_node.h"


///////////////////////////////////////
///////////////////////////////////////
//                                   //
// extern C BEGIN                    //
//                                   //
///////////////////////////////////////
///////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif


/// Type of an handle on a set as seen by the external world.
typedef void* h_dawg_unique_node_set;

/// Creates a new set structure.
h_dawg_unique_node_set dawg_unique_node_set_create();

/// Destroy and reclaim resources of the specified set.
void dawg_unique_node_set_destroy(h_dawg_unique_node_set hSet);

/// Insert a new node into the set.
void dawg_unique_node_set_add(h_dawg_unique_node_set hSet, void* pNode);

/// Transform the set into a flat array.
void dawg_unique_node_set_linearize(h_dawg_unique_node_set hSet, h_dawg_arr_node hArr);

/// Transform the set into a flat array while ensuring that elements are sorted
void dawg_unique_node_set_linearize_sorted(h_dawg_unique_node_set hSet, h_dawg_arr_node hArr);


///////////////////////////////////////
///////////////////////////////////////
//                                   //
// extern C END                      //
//                                   //
///////////////////////////////////////
///////////////////////////////////////
#ifdef __cplusplus
}
#endif


// #ifndef __dawg_unique_node_set_h__
#endif

